import request from '@/config/axios'

// erp系统 商户 VO
export interface MerchantAttendanceVO {
  id: number // 商户假期设置编号

  merchantId: number
  dayWorkingTimeArray: string[] // 上班时间
  monthRestDays: number // 联系人
}

// erp系统 商户 API
export const MerchantAttendanceApi = {
  // erp系统 商户分页
  getMerchantAttendancePage: async (params: any) => {
    return await request.get({ url: `/erp/merchant-attendance/page`, params })
  },

  getMerchantAttendanceList: async (id: number) => {
    return await request.get({ url: `/erp/merchant-attendance/list?id=` + id })
  },

  // erp系统 商户详情
  getMerchantAttendance: async (id: number) => {
    return await request.get({ url: `/erp/merchant-attendance/get?id=` + id })
  },

  // 新增erp系统 商户
  createMerchantAttendance: async (data: MerchantAttendanceVO) => {
    return await request.post({ url: `/erp/merchant-attendance/create`, data })
  },

  // 修改erp系统 商户
  updateMerchantAttendance: async (data: MerchantAttendanceVO) => {
    return await request.put({ url: `/erp/merchant-attendance/update`, data })
  },


  // 更新报销的审核状态
  updateMerchantAttendanceCheckState: async (id: number, checkState: number) => {
    return await request.put({
      url: `/erp/merchant-attendance/update-check`,
      params: {
        id,
        checkState
      }
    })
  },

  // 删除erp系统 商户
  deleteMerchantAttendance: async (id: number) => {
    return await request.delete({ url: `/erp/merchant-attendance/delete?id=` + id })
  },

  // 导出erp系统 商户 Excel
  exportMerchantAttendance: async (params) => {
    return await request.download({ url: `/erp/merchant-attendance/export-excel`, params })
  },
}
